<!--
    This Source Code Form is subject to the terms of the Mozilla Public
    License, v. 2.0. If a copy of the MPL was not distributed with this
    file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->

<!--
    Copyright (c) 2015, Joyent, Inc.
-->

<div class="page-header">
  <h1>Network
    <span name="name">{{name}}</span> / <span name="subnet">{{subnet}}</span>
  </h1>
</div>

<div class="actions">
  <div class="notes-component-container"></div>
  {{#if isNotFabric}}
    {{#role "operators"}}
      <button class="btn btn-info edit-network"><i class="fa fa-pencil"></i> Edit Network</button>
    {{/role}}
  {{/if}}
</div>

{{#if networkIsInUse}}
<div class="alert alert-warning">
    <strong>Note!</strong>
    This network is in use by Servers and/or Virtual Machines. Changes to this network cannot be performed in Operations Portal.
</div>
{{/if}}


<section>
  <ul class="list-unstyled attributes">
    <li>
      <strong>UUID</strong>
      <div class="value selectable">{{uuid}}</div>
    </li>

    {{#if owner_uuids}}
    <li>
      <strong>Owners</strong>
      <div class="value owners">
        {{#each owner_uuids}}
          <div class="owner-details">
            <a class="owner-link" data-owner-uuid="{{this}}" target="_tab" href="/users/{{this}}"><i class="fa fa-external-link"></i> {{this}}</a>
          </div>
        {{/each}}
      </div>
    </li>
    {{/if}}

    <li>
      <strong>VLAN ID</strong>
      <div class="value" name="vlan_id">{{vlan_id}} <span class="vlan-name"></span></div>
    </li>

    <li>
      <strong>Network</strong>
      <div class="value" name="subnet">{{subnet}}</div>
    </li>
    <li>

      <strong>Gateway</strong>
      <div class="value" name="gateway">{{gateway}}</div>
    </li>

    <li>
      <strong>Netmask</strong>
      <div class="value" name="netmask">{{netmask}}</div>
    </li>

    <li>
      <strong>IP Range</strong>
      <div class="value">
        <span name="provision_start_ip">{{provision_start_ip}}</span>
        -
        <span name="provision_end_ip">{{provision_end_ip}}</span>
      </div>
    </li>

    <li>
      <strong>NIC Tag</strong>
      <div class="value" name="nic_tag">{{nic_tag}}</div>
    </li>

    <li>
      <strong>Resolvers</strong>
      <div class="value" name="resolvers">{{resolvers}}</div>
    </li>

    <li>
      <strong>MTU</strong>
      <div class="value" name="mtu">{{mtu}}</div>
    </li>
    {{#if isFabric}}
      <li>
          <strong>Provision a NAT zone</strong>
      <div class="value" name="internet_nat">{{#if internet_nat}}yes{{else}}no{{/if}}</div>
      </li>
    {{/if}}

    <li>
      <strong>Description</strong>
      <div class="value" name="description">{{description}}</div>
    </li>

  </ul>
</section>

<section>
  <div class="routes-list"></div>
</section>

<section>
  <h3>IP Address Allocations</h3>
  <div class="table addresses"></div>
</section>
